﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>ajax</title>
    <style>
        #results {
            border: solid 2px gray;
            height: 200px;
        }
    </style>
</head>
<body>
    <div id="results">
    </div>
</body>
</html>
<script src="Scripts/jquery-2.1.4.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $.ajax({
            url: 'http://services.odata.org/V4/Northwind/Northwind.svc/Products?$select=ProductName',
            success: function (data) {
                console.log(data.value);
            },
            error: function () {
                console.log('an error occured');
            }
        });

        /*
        $.get('http://services.odata.org/V4/Northwind/Northwind.svc/Products?$select=ProductName',
            function(data) {
                console.log(data.value[0]);
            }
        );*/

        /*$.post(
            'http://services.odata.org/V4/Northwind/Northwind.svc/Products?$select=ProductName',
            {value:"value"},
            function(data) {
                console.log(data);
            }
        );*/
    });
</script>
